package com.tubi.Exception;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class demo2 {
    public static void main(String[] args) throws ParseException{

//        int[] arr = {1,2,3,4,5};
        int[] arr = null;
        method1(arr);
    }

    private static void method1(int[] arr) {
        if (arr == null) {
//            System.out.println("参数不能为null");
            throw new NullPointerException();
        }else {
            for (int i = 0; i < arr.length; i++) {
                System.out.println(arr[i]);
            }
        }

    }
}
